﻿package frEngine.animateControler.colorControler
{
    import baseEngine.core.*;
    import frEngine.animateControler.*;
    import frEngine.animateControler.keyframe.*;
    import frEngine.shader.*;

    public class AlphaControler extends MeshAnimateBase
    {

        public function AlphaControler()
        {
            return;
        }// end function

        override public function get type() : int
        {
            return AnimateControlerType.alphaAnimateControler;
        }// end function

        override protected function setTargetProperty(param1) : void
        {
            var _loc_2:MaterialParams = null;
            if (targetMesh)
            {
                _loc_2 = targetMesh.material.materialParams;
                _loc_2.colorOffsetValue[3] = Number(param1);
            }
            return;
        }// end function

        override protected function getBaseValue(param1:Pivot3D) : Object
        {
            return Mesh3D(param1).material.materialParams.alphaBaseValue;
        }// end function

        public function alphaChangeHander() : void
        {
            var _loc_1:MaterialParams = null;
            if (targetMesh)
            {
                _loc_1 = targetMesh.material.materialParams;
                changeBaseValue(null, _loc_1.alphaBaseValue);
                this.toUpdateAnimate(true);
            }
            return;
        }// end function

        override public function dispose(param1:Boolean = true) : void
        {
            var _loc_2:MaterialParams = null;
            if (targetMesh)
            {
                _loc_2 = targetMesh.material.materialParams;
                _loc_2.setAlphaBase(_loc_2.alphaBaseValue);
            }
            super.dispose();
            return;
        }// end function

    }
}
